package com.workerhelping.service.impl;

import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.workerhelping.dao.IncomeCategoryDao;
import com.workerhelping.po.IncomeCategory;
import com.workerhelping.service.IncomeCategoryService;
import org.springframework.stereotype.Service;

@Service
public class IncomeCategoryServiceImpl extends ServiceImpl<IncomeCategoryDao, IncomeCategory> implements IncomeCategoryService {
    @Override
    public void updateMoneyById(Integer icId, Double money) {
        IncomeCategory category = baseMapper.selectById(icId);
        double source_money = category.getCount();
        double result_money = source_money + money;
        category.setCount(result_money);
        baseMapper.updateById(category);
    }
}
